package demo.bocweb.login_module.model;

import demo.bocweb.com.sdk.apiHelper.RetrofitCreateHelper;
import demo.bocweb.com.sdk.apiHelper.RxHelper;
import demo.bocweb.com.sdk.base.BaseModel;
import demo.bocweb.com.sdk.base.bean.BaseBean;
import demo.bocweb.com.sdk.baseApi.AppUrl;
import demo.bocweb.login_module.api.UserApi;
import demo.bocweb.login_module.contract.ResetPwdContract;
import io.reactivex.Observable;
import okhttp3.RequestBody;

/**
 * Created by zhelun on 2018/2/3.
 */

public class ResetPwdModel extends BaseModel implements ResetPwdContract.IResetPwdModel {
    public static ResetPwdModel newInstance() {
        return new ResetPwdModel();
    }

    @Override
    public Observable<BaseBean> resetPwd(RequestBody body) {
        return RetrofitCreateHelper.createApi(UserApi.class, AppUrl.BASE_URL)
                .resetPwd(body)
                .compose(RxHelper.<BaseBean>rxSchedulerHelper());
    }
}
